import request from '@/utils/request'

// 获取企业的部门列表
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}

// 根据id删除部门
// export function delDepartment(id) {
//   return request({
//     url: '/company/department/' + id,
//     method: 'delete'
//   })
// }

// 新增部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据id获取部门信息
export function getDepartmentById(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 根据id修改部门信息
export function editDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

// 根据id删除部门
export function deleteDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}
